{extend name="public:base"}

{block name="right"}

<a href="{:Url('admin/ruleinfo')}" class="btn btn-success">添加规则</a>

{/block}

{block name="main"}
<form role="form">
    <div class="row">
        <div class="col-sm-3 col-xs-12 ">
            <div class="form-group">
                <div class="input-group">
                    <span class="input-group-addon">开始时间:</span>
                    <input type="date" name="start" class="form-control" value="{:input('start')}">
                </div>
            </div>
        </div>
        <div class="col-sm-3 col-xs-12 ">
            <div class="form-group">
                <div class="input-group">
                    <span class="input-group-addon">结束时间:</span>
                    <input type="date" name="end" class="form-control" value="{:input('end')}">
                </div>
            </div>
        </div>
        <div class="col-sm-3 col-xs-12 ">
            <div class="form-group">
                <div class="input-group">
                    <div class="btn-group">
                        <button type="submit" class="btn btn-success" title="立即搜索"><i class="fa fa-fw fa-search"></i></button>
                        {if condition="(input('get.start') gt '') OR (input('get.end') gt '')"}
                        <a href="{:Url('admin/rolelist')}" class="btn btn-default" title="查看全部"><i class="fa fa-close"></i></a>
                        {/if}
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>
<table class="table table-bordered">
    <tbody>
    <tr>
      <th>ID</th>
      <th>权限名称</th>
      <th>规则</th>
      <th>添加时间</th>
      <th>状态</th>
      <th>操作</th>
    </tr>
    {foreach $list as $v}
    <tr>
      <td>{$v['id']}</td>
      <td>{$v['name']}</td>
      <td>{$v['controller']}/{$v['action']}</td>
      <td>{$v['addtime']}</td>
      <td>
        {if condition="$v['status'] eq '1'"}
          <span class="label label-success">正常</span>
        {elseif condition="$v['status'] eq '0'" /}
          <span class="label label-danger">禁用</span>
        {/if}
      </td>
      <td>
          <div class="btn-group" role="group">
            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
              操作
              <span class="caret"></span>
            </button>
            <ul class="dropdown-menu">
              <li><a href="{:Url('admin/ruleinfo',array('id'=>$v['id']))}">修改</a></li>
              {if condition="$v['status'] eq '1'"}
                <li><a href="javascript:setstatus(location.href,{$v['id']},'0')">禁用</a></li>
              {elseif condition="$v['status'] eq '0'"/} 
                <li><a href="javascript:setstatus(location.href,{$v['id']},'1')">启用</a></li>
              {/if}            
              <li><a href="javascript:setstatus(location.href,{$v['id']},'-1',1)">删除</a></li>
            </ul>
          </div>
        
      </td>
    </tr>
    {/foreach}
  </tbody>
</table>
{/block}
{block name="foot"}{$page}{/block}